package JB1;
import java.util.Scanner;
public class NeigNumbers {

	public static void main(String[] args) {
		Scanner sc = new Scanner (System.in);
		int arr [] = new int [6];
		System.out.print ("Enter numbers ");
		
		for (int i=0;i<arr.length;i++){
			arr [i] = sc.nextInt();
		}
		int dist = Math.abs(arr[0]-arr[1]);
		int index = 0;
		
		for (int i=1;i<arr.length-1;i++){
						
			int curDist = Math.abs(arr[i]-arr[i+1]);
			if (curDist<dist){
				dist = curDist;
				index = i;
			}
				
		}
		System.out.print("index "+index+"(Of number "+arr[index]+")");
		
	}
}
